UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q4pGQ8e4yG5K43/iMHcINXxLIopcwZhTLHhI/ezXOIw=' 
WHERE 
  key_id = '3556b0b2710c6aade7699ff3f8caaeb848cff278c904a1a93f5d1258c2050948' 
  AND (
    token = 'Q4pGQ8e4yG5K43/iMHcINXxLIopcwZhTLHhI/ezXOIw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045