UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HHLav6cSKDmxfOQHX9hnFt1ZjRu3T1Cw1A2LTOOeqEU='
WHERE
key_id = '37541ccfe50bdf973dc4603dff6c746c91fb34f1c6881216f4e645b4d151e23f'
AND (
token = 'HHLav6cSKDmxfOQHX9hnFt1ZjRu3T1Cw1A2LTOOeqEU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)