UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Sx4tG5nAHt56GoOzhTpVQ+Hfp/UKGwKxi/zPALTaqLY='
WHERE
key_id = 'e8fc27a8eb3df554cc9ab76dc62840608f66652e420db131c80aa0f880750e15'
AND (
token = 'Sx4tG5nAHt56GoOzhTpVQ+Hfp/UKGwKxi/zPALTaqLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)