UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B4e7UU/F4TvUGV2Il6ANtCr7JRCUhA2pojYAap//lcQ='
WHERE
key_id = 'ae2638b71dc942e19ed8996cda0982e1cddc13a3b64f8f4ff074f7b4634337d8'
AND (
token = 'B4e7UU/F4TvUGV2Il6ANtCr7JRCUhA2pojYAap//lcQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)