UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'olut/9mjpzqROhfXUxX/9dwrvDbg5nMgWBlR9CW+eFw=' 
WHERE 
  key_id = 'a5c9703f707ce641dac5226a6ae2471bec53343e53e202adc66ae7b47fb88d3e' 
  AND (
    token = 'olut/9mjpzqROhfXUxX/9dwrvDbg5nMgWBlR9CW+eFw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031