UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kkNusNHH5NKQp5ZNLyD+CsM6kpmmrdAEdSnmvwjotr0='
WHERE
key_id = 'e4d948c980ba8d24e8515efeb0a39d9c71205dfc20713a0d50aa144b957f5008'
AND (
token = 'kkNusNHH5NKQp5ZNLyD+CsM6kpmmrdAEdSnmvwjotr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)