UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gmb5rZyIghUj3oL+QJvs6Xo8M/IBsYdj+3gULFdZu3M=' 
WHERE 
  key_id = '2b19302747a66708e0f0ac047797915c212884f74eea5bfcc1816125fa3a0e04' 
  AND (
    token = 'Gmb5rZyIghUj3oL+QJvs6Xo8M/IBsYdj+3gULFdZu3M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022