UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wslHy9NMogl4Xud8XjztrxgWoL/vZp0BUdZEM8KISt4=' 
WHERE 
  key_id = '522a9a64a9fb0df4426299af38d8794bb4c47e2d5c5a40c66e596b6f8817bb20' 
  AND (
    token = 'wslHy9NMogl4Xud8XjztrxgWoL/vZp0BUdZEM8KISt4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067