UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PBXoVqPoJcZFk4s5YFkIezQWSOBmHEvXaWLaNvz9PzA='
WHERE
key_id = 'c294e198462f55035484346c75a5c35f03ab70fc2c2bf102a2f0e85e5aa95407'
AND (
token = 'PBXoVqPoJcZFk4s5YFkIezQWSOBmHEvXaWLaNvz9PzA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)