UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gknKTEhNpQdn8/2O78HUO5fcSf5x94hbYsTAOPCb/xM='
WHERE
key_id = '9a52150edffff08ed8c5b012bfaffc50c483117b6c54cf949fe4df8b5a83842e'
AND (
token = 'gknKTEhNpQdn8/2O78HUO5fcSf5x94hbYsTAOPCb/xM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)