UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OM9ADADScQFPjOv7aNncL+h2ajLX2seh9t13o/ZqV9I=' 
WHERE 
  key_id = '00e51bc3a61973566d9d5de0b370c01a0ba03bfc35f71eda5a598e6e5dc1b034' 
  AND (
    token = 'OM9ADADScQFPjOv7aNncL+h2ajLX2seh9t13o/ZqV9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037