UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xwUx0VPFTI7+2gqLZRUK4hBnhCs8XARJPUvuy5bgtk4=' 
WHERE 
  key_id = '7284342b3aa9936c2b4a0d86c7996830de80db9eea0a03b83fe5eff02563f815' 
  AND (
    token = 'xwUx0VPFTI7+2gqLZRUK4hBnhCs8XARJPUvuy5bgtk4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042