UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uFLCuDnyYtoFwLDbgLQhdEhKC2lC2kzaUfzROJN4MEc=' 
WHERE 
  key_id = 'e17be452a76b4ef2461b0201d8c138d7971702a6297e8799a44e6ae265033901' 
  AND (
    token = 'uFLCuDnyYtoFwLDbgLQhdEhKC2lC2kzaUfzROJN4MEc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026