UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JweXgVYrdPPQ0PcXMZ7IP3C/Ab1tY1dKRx0VeYyCilU='
WHERE
key_id = '7a5eab17353140a9af9718819243793e927e5392f88c4254534c500359b2113f'
AND (
token = 'JweXgVYrdPPQ0PcXMZ7IP3C/Ab1tY1dKRx0VeYyCilU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)