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