UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DK/C07UA4lcJ/tCY3mjuTQFyA4Opk6+gUWeqACaHBqg='
WHERE
key_id = '12d8380359df78a383e9469356f08fa9a28db9900f5fbe8ad04b5fc63dbf08f3'
AND (
token = 'DK/C07UA4lcJ/tCY3mjuTQFyA4Opk6+gUWeqACaHBqg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)