UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GhBBmJHDzGAodbYdy1xpQRxn1S8XzyzKSEonZ5SxEoI='
WHERE
key_id = '049be018a4cfc329d8c934771d855565cc49021b3d1bf8d07156d3ee800b7f48'
AND (
token = 'GhBBmJHDzGAodbYdy1xpQRxn1S8XzyzKSEonZ5SxEoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)