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