UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uguga/c7xyZbZjT7LfPtFwNhY/KYowICM5wToBiMMzs='
WHERE
key_id = '18724f2714bb598fc6e03eade636870a093bad740309d56c549f25435280d957'
AND (
token = 'uguga/c7xyZbZjT7LfPtFwNhY/KYowICM5wToBiMMzs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)