UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'waL05WaHkDYR7faGP+osAAyBGs7jQPsb8BQJlXqgU/4=' 
WHERE 
  key_id = '054941b94c07b807900e0ae8368d96845f3fd9306d8b6f9ffb79cd3c9c82032a' 
  AND (
    token = 'waL05WaHkDYR7faGP+osAAyBGs7jQPsb8BQJlXqgU/4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024