UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RfTSJqlrEDZ0SN0nfZSWGQS6UHSqljc2n7OyyU5ElkA=' 
WHERE 
  key_id = '11a7e03f97833c7f6531945921011fd405eed2485ad9fb680201120324acdbcc' 
  AND (
    token = 'RfTSJqlrEDZ0SN0nfZSWGQS6UHSqljc2n7OyyU5ElkA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025