UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jxZbbW/XP8FVueJIvBGW7ZImMOBjHN9eO4BKAVp+34o='
WHERE
key_id = '8678cf79e0ff33d9dc7e6a27ce93d54c927d74328d9edd22c1c1d8180dfd99c6'
AND (
token = 'jxZbbW/XP8FVueJIvBGW7ZImMOBjHN9eO4BKAVp+34o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)