UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DQ76pA+halhSVpze7c2xja64rCQPxB5bUHVTCMROewg=' 
WHERE 
  key_id = '1eb94e8f059978f3834cc1d6e6ecb2d606ddd4d9cafc0a6a539bbf32ecc62cfe' 
  AND (
    token = 'DQ76pA+halhSVpze7c2xja64rCQPxB5bUHVTCMROewg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061