UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PNx5UsR4pdluIV/3bgZv42jJMDu/qGW7y9/60vNforU='
WHERE
key_id = '6447d0958947885b5620e4a5e10f60165fb1a453b51258667c5df5ed87a2fe13'
AND (
token = 'PNx5UsR4pdluIV/3bgZv42jJMDu/qGW7y9/60vNforU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)