UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FgnXqQ3u7t6FKuBEKvVz48YqmctncIiuWb8g0RvZyik=' 
WHERE 
  key_id = 'e08236a417e7b21fd3b565db6642e04d362b9e32d493a6cbf822c34db93edaf8' 
  AND (
    token = 'FgnXqQ3u7t6FKuBEKvVz48YqmctncIiuWb8g0RvZyik=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018