UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XZ3Bv+W3+8y9wQ9F8sr4+olQjl3MZm8hl1EZx6YAwlk=' 
WHERE 
  key_id = 'eb7b34d97cf15b0a499087ffd4ffa6615c6847ffb761d61250d60281d4475aba' 
  AND (
    token = 'XZ3Bv+W3+8y9wQ9F8sr4+olQjl3MZm8hl1EZx6YAwlk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053