UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TBDCsPWrYqR5eH3S/k4vO78fExmAvr+KmICxRHGNVaI='
WHERE
key_id = '673092c72caa858a141ff6ca239f563ccd1d7fe28e37c2fd251d039811aaa4fb'
AND (
token = 'TBDCsPWrYqR5eH3S/k4vO78fExmAvr+KmICxRHGNVaI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)