UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+r0f/DefGPlLFHGddkPbv+PsaiIkR6+TdJpzIWtFf00=' 
WHERE 
  key_id = 'ebf8f52384a051c59f13b237c84253d1bf8dd6045fea58a4b1cad992e46274d8' 
  AND (
    token = '+r0f/DefGPlLFHGddkPbv+PsaiIkR6+TdJpzIWtFf00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017