UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p6PozFkG3FV01hN5LBalKz5TwPQF9649l0F6aLm9U3U='
WHERE
key_id = '834f50b785e3ae20b08e891616e782973a91624fa96bc751615e6beff7b0da98'
AND (
token = 'p6PozFkG3FV01hN5LBalKz5TwPQF9649l0F6aLm9U3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)