UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'spzd9FTgTWniCJRCWNWU0PzNjd9rTUIVRt1FJZEIJ1E='
WHERE
key_id = '4cb64f08bc88c7d784b6eb7ebbdebad6a48e8a0e0f38f8be2ee180c454a5c56b'
AND (
token = 'spzd9FTgTWniCJRCWNWU0PzNjd9rTUIVRt1FJZEIJ1E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)