UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pqELz6DJgIdFfgP2KhuOksPKEfWfLJU3dOQkcELeBZw='
WHERE
key_id = '3d5fab5288b23dea2671f2966e49f2cf86c9160ce10be7b76f89188ebb68cc3e'
AND (
token = 'pqELz6DJgIdFfgP2KhuOksPKEfWfLJU3dOQkcELeBZw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)