UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uMKW4V+kTHKPMU6PtlskdslALhmJbj/AUENXWc18uuc=' 
WHERE 
  key_id = 'db012f6d0ca1cf3d36f37eaac36bcc8be5398da06675f66e298b484e68560d2a' 
  AND (
    token = 'uMKW4V+kTHKPMU6PtlskdslALhmJbj/AUENXWc18uuc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015