UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PBsCWqZiNV+c2DwNEhW9HfzwHJLu/zsEGbFHKyTerKw='
WHERE
key_id = 'c8d7d8304268802f873eea11bbad6e207b6becc36c6b7e6988b2d1dfaae7e59b'
AND (
token = 'PBsCWqZiNV+c2DwNEhW9HfzwHJLu/zsEGbFHKyTerKw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)