UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N1JGaOYizSrDIyQ3dSKb8Eiatyz+PfN8wlHYkxcl/tU='
WHERE
key_id = '973e3e048cd23a46912e4459b2269b15005e52333b6b1db7b71319af2f61fe8b'
AND (
token = 'N1JGaOYizSrDIyQ3dSKb8Eiatyz+PfN8wlHYkxcl/tU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)