UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '30tRRsKH4Dl+Hq1asJLaikNFnSUAuQASvHcrp8Tqxms=' 
WHERE 
  key_id = '4356e1aae60230e9d555c6f97c836117c128c03dd3cccc2de1f793d52e6ab4ca' 
  AND (
    token = '30tRRsKH4Dl+Hq1asJLaikNFnSUAuQASvHcrp8Tqxms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049