UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oH7ENFSdO8AH6T5Gffc2cEPlsWYhBUOHqGicQCVNn9M='
WHERE
key_id = '130678eb8c5f2732e7b8828703c0f0076ef0456f0780ae3530dc2a9e262f0fab'
AND (
token = 'oH7ENFSdO8AH6T5Gffc2cEPlsWYhBUOHqGicQCVNn9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)