UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TDScxviucmTkSv5J5HRXe1xitDLeqMmnQHNr8OkTXUE='
WHERE
key_id = '744b59f20047a540c1f5973a59505ffbd14f6adb8f86b60b55239f198c138596'
AND (
token = 'TDScxviucmTkSv5J5HRXe1xitDLeqMmnQHNr8OkTXUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)