UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JVSNl7FzGFJy+yArlCGsB38Mf+J2vMX9GwS69UDC1xk='
WHERE
key_id = '69c5ecaf7783292dceb944727124a9fa6c4f8134ed16c2f8c12cc273edc7fee1'
AND (
token = 'JVSNl7FzGFJy+yArlCGsB38Mf+J2vMX9GwS69UDC1xk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)