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

Query time 0.00042