UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L3r9RjWA1F9WKVQNHlswVvSU1G3HuvDnlli48tCrUSM=' 
WHERE 
  key_id = '55c85a8aa6b11ebe1c1ff4b6a8eb649a73c1202233b00f955a9d4305cfc583ab' 
  AND (
    token = 'L3r9RjWA1F9WKVQNHlswVvSU1G3HuvDnlli48tCrUSM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042