UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rDaeZFF6g5jJR9ixo8ZJIP1ZMd89pl9kblckyiriOTU=' 
WHERE 
  key_id = '2d240b56778484ffc8f03b3e87dc70814a31c93996fc3717d0f78c268cd28911' 
  AND (
    token = 'rDaeZFF6g5jJR9ixo8ZJIP1ZMd89pl9kblckyiriOTU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027