UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pBzxwj/66wpn3nPdyCrj1snd66AeIvv2TAimmZXDbu0=' 
WHERE 
  key_id = '48514c5d7f02846cd37bdda223525353005b1abf5f7a64c8b8b46039832719c9' 
  AND (
    token = 'pBzxwj/66wpn3nPdyCrj1snd66AeIvv2TAimmZXDbu0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024